/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package GetData;

import DTO.sinhvien;
import dktc_ws.DKTCWebService_Service;
import dktc_ws.Giangvien;
import dktc_ws.ChitietPhong;
import dktc_ws.Quantri;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

/**
 *
 * @author THIENSUHACK
 */
public class DataWS {
    public static dktc_ws.DKTCWebService_Service sv=new DKTCWebService_Service();
    public static dktc_ws.DKTCWebService port;
    
    public DataWS()
    {
        port=sv.getDKTCWebServicePort();
    }
    public String kiemtraketnoi()
    {
        String str="";
        str=port.kiemtraketnoi();
        return str;
    }
    
    public int themtaikhoan(String tendangnhap, String email, String matkhau)
    {
        return port.themQuanTri(tendangnhap, email, matkhau);
    }
    
    public int suataikhoan(int mataikhoan, String tendangnhap, String email, String matkhau)
    {
        return port.suaQuanTri(mataikhoan, tendangnhap, email, matkhau);
    }
    
    public int xoataikhoan(int mataikhoan)
    {
        return port.xoaQuanTri(mataikhoan);
    }
    
    public int themtintuc(String tuade,String motangan,int maquantri, String ngaydang,String noidung)
    {
        return port.themTinTuc(tuade, motangan, maquantri, ngaydang, noidung);
    }
    
    public int suatintuc(String tuade,String motangan,int matintuc, int maquantri, String ngaydang,String noidung)
    {
        return port.suaTinTuc(matintuc,tuade, motangan,  maquantri, noidung);
    }
    
    public int xoatintuc(int matintuc)
    {
        return port.xoaTinTuc(matintuc);
    }
    
    public int themphong(int sophong, int succhua, int tang)
    {
        int result = 0;
        result = port.themPhong(sophong,succhua, tang); 
        return result;
    }
    
    public int suaphong(int sophong, int succhua, int tang)
    {
        int result = 0;
        result = port.suaPhong(sophong,succhua, tang); 
        return result;
    }
    
    public int xoaphong(int sophong)
    {
        int result = 0;
        result = port.xoaPhong(sophong);
        return result;
    }
    
    public int xoaCTPhong(int sophong, int malop)
    {
        return port.xoaChiTietPhong(sophong, malop);
    }
    
    public int laySoPhong(int malop)
    {
        int result = 0;
        result = port.laySoPhong(malop);
        return result;
    }
    
    public int themnamhoc(int nam1, int nam2)
    {
        int result = 0;
        result=port.themNamHoc(nam1, nam2);
        return result;
    }
    
    public int suanamhoc(int manamhoc, int nam1, int nam2)
    {
        int result = 0;
        result=port.suaNamHoc(manamhoc, nam1, nam2);
        return result;
    }
    
    public int xoanamhoc(int manamhoc)
    {
        int result = 0;
        result = port.xoaNamHoc(manamhoc);
        return result;
    }
    
    public int themhocky(int manamhoc,String tenhk,String thoigianbatdaudk,String thoigianketthucdk)
    {
        int result = 0;
        result = port.themHocKy(manamhoc, tenhk, thoigianbatdaudk, thoigianketthucdk);
        return result;
    }
    
    public int suahocky(int mahocky, int manamhoc,String tenhk,String thoigianbatdaudk,String thoigianketthucdk)
    {
        int result = 0;
        result = port.suaHocKy(mahocky,manamhoc, tenhk, thoigianbatdaudk, thoigianketthucdk);
        return result;
    }
    
    public int suahockyhientai(int mahocky)
    {
        return port.suaHocKyHienTai(mahocky);
    }
    
    public int xoahocky(int mahocky)
    {
        int result = 0;
        result = port.xoaHocKy(mahocky);
        return result;
    }
    
     public int themsinhvien(String masv,String hoten,short gioitinh,String ngaysinh,String diachi,String email,String phone,String matkhau,short trangthai)
    {
        int result=0;
        result=port.themSinhVien(masv, hoten, gioitinh, ngaysinh, diachi, email, phone, matkhau, trangthai);
        return result;
    }
     
     
     public int themsinhvien2(String masv,String hoten)
    {
        int result=0;
        result=port.themSinhVienTest(masv, hoten);
        return result;
    }
     public int xoasinhvien(String masv)
     {
         return port.xoaSinhVien(masv);
     }
     public List<dktc_ws.Sinhvien> laydanhsachsinhvien(String id)
     {
         
         List<dktc_ws.Sinhvien> a=new LinkedList<dktc_ws.Sinhvien>();
         a=port.layDanhSachSinhVien("-1");
         return a;
     }
      public dktc_ws.Sinhvien laymotsinhvien(String masv)
     {
         dktc_ws.Sinhvien a=new dktc_ws.Sinhvien();
         a=port.layMotSinhVien(masv);
         return a;         
     }
      public int capnhatsinhvien(String masv,String hoten,short gioitinh,String ngaysinh,String diachi,String email,String phone,String matkhau,short trangthai)
      {
          return port.capNhatSinhVien(masv, hoten, gioitinh, ngaysinh, diachi, email, phone, trangthai);
      }
      public int capnhatmatkhausinhvien(String masv,String mkcu, String mkmoi)
      {
          return port.doiMatKhauSinhVien(masv, mkcu, mkmoi);
      }
      public int capnhatsoluongdadk()
     {
         return port.capNhatSoLuongDaDK();
     }
     public int themgiangvien(String hoten,short gioitinh,String ngaysinh,String hocvi,String diachi,String email,String phone)
    {
        int result=0;
        result=port.themGiangVien(hoten, gioitinh, ngaysinh, hocvi, diachi, email, phone);
        return result;
    }
     
     public int suagiangvien(int magv,String hoten,short gioitinh,String ngaysinh,String hocvi,String diachi,String email,String phone)
     {
         int result = 0;
         result = port.suaGiangVien(magv, hoten, gioitinh, ngaysinh, hocvi, diachi, email, phone);
         return result;
     }
     
     public int xoagiangvien(int magv)
     {
         int result = 0;
         result = port.xoaGiangVien(magv);
         return result;
     }
     
    public int themmonhoc(String mamh, String tenmh, short tongsotc, short tclythuyet, short tcthuchanh) 
    {
        int result = 0;
        result = port.themMonHoc(mamh, tenmh, tongsotc, tclythuyet, tcthuchanh);
        return result;
    }
    
    public int suamonhoc(String mamh, String tenmh, short tongsotc, short tclythuyet, short tcthuchanh) 
    {
        int result = 0;
        result = port.suaMonHoc(mamh, tenmh, tongsotc, tclythuyet, tcthuchanh);
        return result;
    }
    
    public int xoamonhoc(String mamh)
    {
        int result=0;
        result = port.xoaMonHoc(mamh);
        return result;
    }
    
    public int themtienquyet(String mamh, String mamontq)
    {
        int result = port.themMonTienQuyet(mamontq, mamh);
        return result;
    }
    
    public int xoatienquyet(String mamh)
    {
       int result = port.xoaMonTienQuyet2(mamh);
       return result;
    }
    
    public int themlophoc(String mamonhoc, int magiangvien, int sisotoida, int mahocky, int thu, int ca)
    {
        int result = 0;
        result = port.themLopHoc(mamonhoc, magiangvien, mahocky, sisotoida, 0, thu, ca);
        return result;
    }
    
    public int sualophoc(int malop, String mamonhoc, int magiangvien, int sisotoida, int mahocky, int thu, int ca)
    {
        int result = 0;
        result = port.suaLopHoc(malop, mamonhoc, magiangvien, mahocky, sisotoida, thu, ca);
        return result;
    }
    
    public int xoalophoc(int malop)
    {
        int result = 0;
        result = port.xoaLopHoc(malop);
        return result;
    }
    
    public int themCTPhong(int sophong, int malop)
    {
        int result = 0;
        result = port.themChiTietPhong(sophong, malop,0,0);
        return result;
    }
    
    public int themphieudangky(String masv,int mahk,String ngaydangky)
    {
        return port.themPhieuDangKy(masv, mahk, ngaydangky);
    }
    public int themchitietphieudangky(int mapdk,int malop)
    {
        return port.themChiTietPhieuDangKy(mapdk,malop);
    }
    public int xoachitietphieudangky(int mapdk)
    {
        return port.xoaChiTietPhieuDangKy(mapdk);
    }
    public int kiemtraphieudksinhvien(String masv)
    {
        int result=port.kiemTraPhieuDKSinhVien(masv);
        return result;
    }
    public dktc_ws.Thamso laythamso()
    {
        dktc_ws.Thamso a=port.layThamSo();
        return a;
    }
     public List<dktc_ws.Giangvien> laydanhsachgiangvien(int magv)
     {
         List<dktc_ws.Giangvien> a=new LinkedList<Giangvien>();
         a=port.layDanhSachGiangVien(magv);
         return a;
     }
     public List<dktc_ws.Thongtindk> laythongtindangky()
     {
         List<dktc_ws.Thongtindk> a=new LinkedList<dktc_ws.Thongtindk>();
         a=port.layThongTinDangKy();
         return a;
     }
     public List<dktc_ws.Monhoc> laydanhsachmonhoc(String mamh)
     {
         List<dktc_ws.Monhoc> a=new LinkedList<dktc_ws.Monhoc>();
         a=port.layDanhSachMonHoc(mamh);
         return a;
     }
     public List<dktc_ws.Hocky> laydanhsachhocky(int mahk)
     {
         List<dktc_ws.Hocky> a=new LinkedList<dktc_ws.Hocky>();
         a=port.layDanhSachHocKy(mahk);
         return a;
     }
      public List<dktc_ws.Lophoc> laydanhsachlophoc(int malop)
     {
         List<dktc_ws.Lophoc> a=new LinkedList<dktc_ws.Lophoc>();
         a=port.layDanhSachLopHoc(malop);
         return a;
     }
       public List<dktc_ws.Thongtindk> laydanhsachlophocsinhviendk(String masv)
     {
         List<dktc_ws.Thongtindk> a=new LinkedList<dktc_ws.Thongtindk>();
         a=port.layDanhSachLopHocCuaSinhVienDK(masv);
         return a;
     }
     public List<dktc_ws.Montienquyet> laydanhsachmontienquyet(String mamontq)
     {
         List<dktc_ws.Montienquyet> a=new LinkedList<dktc_ws.Montienquyet>();
         a=port.layDanhSachMonTienQuyet(mamontq);
         return a;
     }
     public List<dktc_ws.Namhoc> laydanhsachnamhoc(int manamhoc)
     {
         List<dktc_ws.Namhoc> a=new LinkedList<dktc_ws.Namhoc>();
         a=port.layDanhSachNamHoc(manamhoc);
         return a;
     }
     
      public List<dktc_ws.Phieudangky> laydanhsachphieudangky(int mapdk)
     {
         List<dktc_ws.Phieudangky> a=new LinkedList<dktc_ws.Phieudangky>();
         a=port.layDanhSachPhieuDangKy(mapdk);
         return a;
     }
      
      public List<Integer> laydsmapdktheolophoc(int malop)
      {
          return port.layDSChiTietPhieuDangKy(malop);
      }
      
      public List<dktc_ws.Phong> laydanhsachphong(int sophong)
     {
         List<dktc_ws.Phong> a=new LinkedList<dktc_ws.Phong>();
         a=port.layDanhSachPhong(sophong);
         return a;
     }
      
      public List<dktc_ws.Phong> laydanhsachphongtrong(int thu, int ca, int mahk)
      {
          List<dktc_ws.Phong> a = new LinkedList<dktc_ws.Phong>();
          a = port.layDanhSachPhongTrong(thu, ca, mahk);
          return a;
      }
      public List<dktc_ws.Quantri> laydanhsachquantri(int manguoidung)
     {
         List<dktc_ws.Quantri> a=new LinkedList<dktc_ws.Quantri>();
         a=port.layDanhSachQuanTri(manguoidung);
         return a;
     }
      public dktc_ws.Quantri laymotquantri(String tendangnhap)
      {
          return port.layMotQuanTri(tendangnhap);
      }
      public List<dktc_ws.Tintuc> laydanhsachtintuc(int matintuc)
     {
         List<dktc_ws.Tintuc> a=new LinkedList<dktc_ws.Tintuc>();
         a=port.layDanhSachTinTuc(matintuc);
         return a;
     }
     /*public int laysoluongsinhvien()
     {
         int a=port.soluongsinhvien("-11");
         return a;
     }*/
      public dktc_ws.Thongtinnamhochientai laythongtinnamhochientai()
      {
          return port.layThongTinNamHocHienTai();
      }
     
}